package com.xdtech.parking.service;

import java.util.List;

import com.xdtech.common.service.IBaseService;
import com.xdtech.parking.model.ParkingDevice;
import com.xdtech.parking.protocol.vo.ParkDeviceInfo;
import com.xdtech.parking.vo.BillDetail;
import com.xdtech.parking.vo.ParkingDeviceItem;

/**
 * 
 * @author max.zheng
 * @create 2015-06-18 14:30:33
 * @since 1.0
 * @see
 */
public interface ParkingDeviceService extends IBaseService<ParkingDevice>{

	/**
	 * 保存更新信息
	 * @author max.zheng
	 * @create 2015-06-18 14:30:33
	 * @modified by
	 * @param item
	 * @return
	 */
	boolean saveOrUpdateParkingDevice(ParkingDeviceItem item);

	/**
	 * 加载记录信息
	 * @author max.zheng
	 * @create 2015-06-18 14:30:33
	 * @modified by
	 * @param newId
	 * @return
	 */
	ParkingDeviceItem loadParkingDeviceItem(Long parkingDeviceId);

	/**
	 * 根据id号删除记录信息
	 * @author max.zheng
	 * @create 2015-06-18 14:30:33
	 * @modified by
	 * @param id
	 * @return
	 */
	boolean deleteParkingDeviceInfo(long id);

	/**
	 * 
	 * @author max.zheng
	 * @create 2015-06-18 14:30:33
	 * @modified by
	 * @param parkingDeviceIds
	 */
	boolean deleteParkingDeviceInfo(List<Long> parkingDeviceIds);
	
	/**
	 * 加载vo列表条目
	 * @author max.zheng
	 * @create 2015-06-18 14:30:33
	 * @modified by
	 * @return
	 */
	List<ParkingDeviceItem> loadItems();

	/**
	 * 根据设备上传信息更新，包含状态，车位是否有车，心跳
	 * @author max.zheng
	 * @create 2015-6-20上午10:34:29
	 * @modified by
	 * @param parkDeviceInfos
	 */
	List<ParkDeviceInfo> updateDevicePostInfo(List<ParkDeviceInfo> parkDeviceInfos);

	/**
	 * 检测统一区域下是否含有该设备代码
	 * @author max.zheng
	 * @create 2015-6-20下午11:04:50
	 * @modified by
	 * @param areaCode
	 * @param deviceCode
	 * @return
	 */
	boolean checkDeviceCodeIsExit(String areaCode, String deviceCode);

	/**
	 * 开启
	 * @author max.zheng
	 * @create 2015-6-21上午1:01:38
	 * @modified by
	 * @param id
	 * @return
	 */
	void turnOn(Long id);

	/**
	 * 关闭
	 * @author max.zheng
	 * @create 2015-6-21上午1:02:09
	 * @modified by
	 * @param id
	 * @return
	 */
	void turnOff(Long id);
	/**
	 * 关闭
	 * 
	 * @author max.zheng
	 * @create 2015-7-1下午11:55:51
	 * @modified by
	 * @param deviceUnique
	 */
	void turnOff(String aid,String ukid);

	/**
	 * 根据区域id和停车设备编号（泊车号），结算费用
	 * @author max.zheng
	 * @create 2015-7-3下午8:21:34
	 * @modified by
	 * @param aid
	 * @param parkNo
	 * @return
	 */
	BillDetail loadBillInfo(String aid, String parkNo);

	/**
	 * 
	 * @author <a href="max.zheng@zkteco.com">郑志雄</>
	 * @since 2015-7-6 下午4:54:46
	 * @param aid
	 * @param parkNo
	 * @param operationType
	 */
	boolean operation(String aid, String parkNo, String operationType);
}
